package Classes.GameViews.ViewPanels
{
	import Classes.GameUtils.GU_Sound;
	import Classes.GameViews.ViewScenes.VS_Main;
	import Classes.Managers.M_Communication;
	
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.system.ApplicationDomain;
	
	/**
	 *设置性别跟技能类 
	 * @author 邓坚
	 * 
	 */	
	public class VP_selectSex extends ViewPanel
	{
		private static var _instance:VP_selectSex;
		private var _interfaceUI:Sprite;
		//		private var _ratio:Number;			//金币与o币对兑率   比如1000 就是1欧等于1000金币
		
		public function VP_selectSex()
		{
			init();
		}
		
		private function init():void
		{
			_interfaceUI=new (ApplicationDomain.currentDomain.getDefinition("SelectSex_panel_v") as Class);
			this.addChild(this._interfaceUI);
			addListener();
		}
		
		public function addListener():void
		{
			this.addEventListener("confirm",confirmHandler);
			this.addEventListener("btnnOver", function(e:Event):void{
				GU_Sound.instance.playCommSound("Button_stone");
			});
			this.addEventListener("btnlOver", function(e:Event):void{
				GU_Sound.instance.playCommSound("Button_stone");
			});
		}
		
		/**
		 *打开面板 
		 * 
		 */
		public function openPanel():void
		{
			this.openAt(VS_Main.instance,true);
			this.toCenter();
		}
		
		/**
		 *确认处理 
		 * @param e
		 * 
		 */
		public function confirmHandler(e:Event):void
		{
			 M_Communication.instance.send(127010,{sex:this.interfaceUI["sex"],roleId:(this.interfaceUI["skill"])});
		}
		
		
		public static function get instance():VP_selectSex
		{
			if(!_instance)_instance=new VP_selectSex();
			return _instance;
		}
		
		public function get interfaceUI():Sprite
		{
			return _interfaceUI;
		}
	}
}